
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%--<html>--%>
<%--<head>--%>
<%--    <title>手机全部信息</title>--%>
<%--</head>--%>
<%--<body>--%>
<%--      <table border="1px" align="center">--%>
<%--          <thead>--%>
<%--              <tr>--%>
<%--                <th>ID</th>--%>
<%--                <th>手机名称</th>--%>
<%--                <th>价格</th>--%>
<%--                <th>状态</th>--%>
<%--                <th>品牌</th>--%>
<%--                <th>操作</th>--%>
<%--              </tr>--%>
<%--          </thead>--%>
<%--          <tbody>--%>
<%--          <c:forEach var="p" items="${requestScope.phoneList}">--%>
<%--            <tr>--%>
<%--                <td>${p.getPid()}</td>--%>
<%--                <td>${p.getPname()}</td>--%>
<%--                <td>${p.getPrice()}</td>--%>
<%--                <td><c:if test="${p.state==1}">有货</c:if>--%>
<%--                    <c:if test="${p.state==0}">无货</c:if>--%>
<%--                </td>--%>
<%--                <td>${p.getBrandId()}</td>--%>
<%--                <td><a href="${pageContext.request.contextPath}/DeletePhoneByIdController?id=${p.pid}">删除</a>--%>
<%--                    <a href="${pageContext.request.contextPath}/SelectPhoneByIdController?id=${p.pid}">修改</a>--%>
<%--                </td>--%>
<%--            </tr>--%>
<%--          </c:forEach>--%>
<%--          </tbody>--%>
<%--      </table>--%>
<%--      <center>--%>
<%--          <a href="${pageContext.request.contextPath}/addPhone.jsp">添加</a>--%>
<%--      </center>--%>
<%--</body>--%>
<%--</html>--%>


<html>
<head>
    <meta charset="utf-8" />
    <title>手机管理系统</title>
    <link rel="stylesheet"type="text/css" href="css/file.css"/>
</head>
<body>
<div class="navbar">
    <div class="container">
        <a class="logo" href="#">手机管理系统</a>
        <nav class="userbar">
            <ul class="cl">
                <li class="lfet">欢迎:</li>
                <li class="lfet">${sessionScope.user.username}登录</li>
                <li class="lfet"><a href="${pageContext.request.contextPath}/RemoveController" style="color: #fff;">退出</a></li>
            </ul>
        </nav>
    </div>
</div>
<div class="article">
    <div class="bor">
        <div class="bg">
					<span class="lfet">
						<a href="${pageContext.request.contextPath}/SelectAllBrandController" class="btn btn-primary radius">添加用户</a>
						<a href="${pageContext.request.contextPath}/SelectAllBrandAndPhoneNum" class="btn btn-primary radius">品牌管理</a>
					</span>
        </div>
        <div>
            <form action="${pageContext.request.contextPath}/multiDelete">
                <table class="table table-border table-bordered table-hover table-bg table-sort">
                    <thead>
                    <tr class="text-c">
                        <th width="25"><input type="submit" class="btn btn-primary radius" value="批量删除"/></th>
                        <th width="80">ID</th>
                        <th width="80">手机名称</th>
                        <th width="80">价格</th>
                        <th width="80">状态</th>
                        <th width="80">品牌</th>
                        <th width="130">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach var="phone" items="${requestScope.phoneList}">
                    <tr class="text-c">
                        <td><input type="checkbox" value="${phone.pid}" name="ids"></td>
                        <td>${phone.pid}</td>
                        <td>${phone.pname}</td>
                        <td>${phone.price}</td>
                        <td class="td-status">
                            <c:if test="${phone.state==1}">
                           <span class="label label-success radius">有货</span>
                            </c:if>
                            <c:if test="${phone.state==0}">

                            <span class="label label-warning radius">无货</span>
                            </c:if>
                        <td>${requestScope.map[phone.brandId]}</td>
                        <td class="td-manage">
                            <a style="text-decoration:none" href="${pageContext.request.contextPath}/DeletePhoneByIdController?id=${phone.pid}">删除</a>
                            <a style="text-decoration:none" href="${pageContext.request.contextPath}/SelectPhoneByIdController?id=${phone.pid}">修改</a>
                        </td>
                    </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </form>
        </div>
        <div class="dataTables_info" id="DataTables_info">当前是第${requestScope.curPage}页 ，共 ${requestScope.totalPage}页</div>
        <div class="dataTables_paginate" id="DataTables_paginate">
            <c:if test="${requestScope.curPage>1}">
            <a class="paginate_button" id="previous" href="${pageContext.request.contextPath}/selectByPageController?curPage=${requestScope.curPage-1}">上一页</a>
            </c:if>
            <c:if test="${requestScope.curPage<requestScope.totalPage}">
            <a class="paginate_button" id="next" href="${pageContext.request.contextPath}/selectByPageController?curPage=${requestScope.curPage+1}">下一页</a>
            </c:if>
        </div>
<%--        <div class="dataTables_info" id="DataTables_info">当前是第${requestScope.curPage}页 ，共${totalPage}页</div>--%>
<%--        <div class="dataTables_paginate" id="DataTables_paginate">--%>
<%--            <c:if test="${curPage>1}">--%>
<%--                <a href="${pageContext.request.contextPath}/selectByPage?curPage=${curPage-1}" class="paginate_button" id="previous">上一页</a>--%>
<%--            </c:if>--%>
<%--            <c:if test="${curPage<totalPage}">--%>
<%--                <a href="${pageContext.request.contextPath}/selectByPage?curPage=${curPage+1}" class="paginate_button" id="next">下一页</a>--%>
<%--            </c:if>--%>
<%--        </div>--%>
    </div>
</div>
</body>
</html>
